<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>双向的数据绑定</title>
    <script src="/js/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="name">{{name}} {{age}} {{flag}}
    <hr/>
    <p>插值表达式中调用方法时一定记得加()</p>
    {{sayHi()}}
    <hr/>
    {{ [1,2,3,4,5][2] }}
    <hr/>
    <p>大括号中间一定记得留个空格</p>
    {{ {name:"广坤",age:19} }}
    <hr/>
    {{ {name:"广坤",age:19}.name }}
    <hr />
    {{ arr[1] }}
</div>

<script>
    new Vue({
        el: "#app",
        data: {
            name: "陈芳芳",
            age: 18,
            flag: true,
            arr: ["王森正","陈开心","乔飞扬"]
        },
        methods: {
            sayHi: function () {
                return "Hello VUE!";
            }
        }
    });
</script>
</body>
</html>